const {ccclass, property} = cc._decorator;

@ccclass
export default class NetStatus extends cc.Component {

    @property(cc.Label)
    label: cc.Label = null;
    socket = null;
    onLoad() {
       
    }

    bindSocket(socket){
        
        if(this.socket){
            cc.log("无法重复设置socket")
            return;
        }
        this.socket = socket
    }

    updateScan(){
        if(!this.socket.connected){
            this.node.active = true;
            this.label.string = "正在连接";
        }else{
            this.label.string = "连接成功";
            this.node.active = false;
        }
    }
}
